package xyz.flowlight.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import xyz.flowlight.domain.entity.Product;

import java.util.List;

@Mapper
public interface ProductMapper extends BaseMapper<Product> {
    /**
     * 商品名称模糊查询
     * (等效于原JPA的 findByNameContaining)
     */
    @Select("SELECT * FROM product WHERE name LIKE CONCAT('%', #{keyword}, '%')")
    List<Product> findByNameContaining(@Param("keyword") String keyword);
}
